
'''
 该案例演示运算符
'''
# -------------算数运算符--------------------
# num1 = 10
# num2 = 4
# # 加
# print(num1 + num2)
# # 减
# print(num1 - num2)
# # 乘
# print(num1 * num2)
# # 除法
# print(num1 / num2)
#
# # //  整除  除后往下取整
# print(num1 // num2)
#
# # // % 返回除法的余数
# print(num1 % num2)
#
# #  ** 幂
# print(num2 ** 2)

# ---------------赋值运算符-----------------------------
# = 赋值
num1 = 10
# # += 加法赋值
# num2 = num1 + 5
# num1 += 5
#
# # -= 减法赋值
# num1 -= 5
#
# # *= 乘法赋值
# num1 *= 5
#
# # /= 除法赋值
# num1 /= 5
#
# # //= 整除赋值
# num1 //= 5
#
# # %= 模赋值
# num1 %= 5
#
# # **= 幂赋值
# num1 **= 5

#  := 海象运算符, 在表达式中同时进行赋值和返回赋值的值,在python3.8新增
num2 = num1 * 2
print(num2  > num1)
print(num2  := num1 * 2 > num1)
